<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	template="/templates/masterPage.xhtml">

	<ui:define name="pageHeader">
		<div>
			<h1>Subscriptions</h1>
		</div>
	</ui:define>

	<ui:define name="content">

		<h:form id="subscr_form">

			<f:event type="preRenderView"
				listener="#{subscriptionBean.reloadSubscriptions()}" />

			<p:dataTable id="subscrTable" var="subscr"
				value="#{subscriptionBean.subscriptions}" paginator="true" rows="10"
				paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="10,20,30" styleClass="tables text"
				emptyMessage="No subscriptions.">



				<p:column filterBy="file.name" sortBy="file.name"
					filterMatchMode="contains">
					<f:facet name="header">  
           			     File  
            		</f:facet>
					<h:outputText value="#{subscr.file.name}" />
				</p:column>

				<p:column filterBy="file.qualifiedName" sortBy="file.qualifiedName"
					filterMatchMode="contains" >
					<f:facet name="header">  
                		Path  
         		    </f:facet>

					<h:outputText value="#{subscr.file.qualifiedName}" style="float: left"/>
				</p:column>


				<p:column width="20" styleClass="buttonAlign">
					<f:facet name="header">  
             		   Subscription  
          			</f:facet>

					<p:commandButton icon="ui-icon-trash" title="Unsubscribe"
						actionListener="#{subscriptionBean.deleteSubscription(subscr)}"
						update="subscrTable" style="text-align: center" />

				</p:column>


			</p:dataTable>




		</h:form>

		<ui:insert name="feedback">
			<ui:include src="/templates/feedback.xhtml" />
		</ui:insert>
	</ui:define>

	<ui:define name="footer">
		<div />
	</ui:define>
</ui:composition>